package fr.mywiki.business.entry.meta.datatype.text;

import java.text.ParseException;
import java.util.Locale;

import org.jdom.Element;

import fr.mywiki.business.entry.meta.DataType;
import fr.mywiki.business.resources.ResourceManager;

/**
 * Data type which represents a text in wiki mode.
 */
public class WikiText implements DataType {
  public static final String TYPE_NAME = "wikiText";
  
  public static final String TYPE_BUNDLE_KEY = "model.type.wikiText.display";

  public String getTypeName() {
    return TYPE_NAME;
  }
  
  public String getDisplayKey() {
  	return TYPE_BUNDLE_KEY;
  }

	public String checkValue(Object value) {
		return null;
	}

	public String describe(Locale locale) {
		return ResourceManager.getMessage(TYPE_BUNDLE_KEY, locale);
	}

	public void describeXml(Element a_elt) {
		// Nothing particular to add.
	}

	public void fillFromXml(Element elt) {
		// Nothing particular to add.
	}

	public Object getValue(String strVal) throws ParseException {
		return strVal;
	}
}
